{% extends "admin/change_form.html" %}
{% load i18n admin_modify adminmedia %}

{% block content %}<div id="content-main">
{% block object-tools %}
{% if change %}{% if not is_popup %}
  <ul class="object-tools"><li><a href="history/" class="historylink">{% trans "History" %}</a></li>
  {% if has_absolute_url %}<li><a href="../../../r/{{ content_type_id }}/{{ object_id }}/" class="viewsitelink">{% trans "View on site" %}</a></li>{% endif%}
  </ul>
{% endif %}{% endif %}
{% endblock %}
<form {% if has_file_field %}enctype="multipart/form-data" {% endif %}action="{{ form_url }}" method="post" id="{{ opts.module_name }}_form">{% block form_top %}{% endblock %}
<div>
{% if is_popup %}<input type="hidden" name="_popup" value="1" />{% endif %}
{% if save_on_top %}{% submit_row %}{% endif %}
{% if errors %}
    <p class="errornote">
    {% blocktrans count errors|length as counter %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktrans %}
    </p>
    <ul class="errorlist">{% for error in adminform.form.non_field_errors %}<li>{{ error }}</li>{% endfor %}</ul>
{% endif %}

{% include "admin/cart/cart_detail.html" %}

{% for fieldset in adminform %}
  {% include "admin/includes/fieldset.html" %}
{% endfor %}


{% block after_field_sets %}{% endblock %}

{% for inline_admin_formset in inline_admin_formsets %}
    {% include inline_admin_formset.opts.template %}
{% endfor %}

<div class="submit-row" {% if is_popup %}style="overflow: auto;"{% endif %}>
	<input type="submit" value="{% trans 'Save' %}" class="default" name="_save" />
	<p class="deletelink-box"><a href="delete/" class="deletelink">{% trans "Delete" %}</a></p>
	{% if show_save_and_continue %}<input type="submit" value="{% trans 'Save and continue editing' %}" name="_continue" {{ onclick_attrib }}/>{% endif %}
</div>

{% if adminform and add %}
   <script type="text/javascript">document.getElementById("status").focus();</script>
{% endif %}

</div>
</form></div>
{% endblock %}
